
import axios from '@/utils/request'

// 入库分页
export const pageWarehousing = (params) => {
  return axios({
    method: 'GET',
    url: 'warehousing/pageWarehousing',
    params
  })
}
// 详情
export const warehousingDetail = (id) => {
  return axios({
    method: 'GET',
    url: `warehousing/warehousingDetail/${id}`
  })
}

export const totalPageWarehousingAmount = (params) => {
  return axios({
    method: 'GET',
    url: 'warehousing/totalPageWarehousingAmount',
    params
  })
}
// 提交
export const submitWarehousingApply = (data) => {
  return axios({
    method: 'POST',
    url: 'warehousing/submitWarehousingApply',
    data
  })
}
// 修改
export const modifyWarehousingApply = (data) => {
  return axios({
    method: 'POST',
    url: 'warehousing/modifyWarehousingApply',
    data
  })
}
// 删除
export const deleteWarehousing = (id) => {
  return axios({
    method: 'POST',
    url: `warehousing/deleteWarehousing/${id}`
  })
}

// 获取仓库下拉数据源
export const getWarehouseList = () => {
  return axios({
    method: 'GET',
    url: '/repository/allRepository',

  })
}

export const findRepStock =(params)=>{
  return axios({
    method: 'GET',
    url: '/stockCheck/findRepStock',
    params
  })
}
// 获取采购下拉数据源
export const getPurchaseList = () => {
  return axios({
    method: 'GET',
    url: '/procurementPlan/allProcurementList',
  })
}

// 获取采购下拉数据源
export const getApplyPurchaseList = () => {
  return axios({
    method: 'GET',
    url: '/procurementApply/allProcurementList',
  })
}

// 根据采购获取物料据源
export const getPurchaseMaterialList = (planId) => {
  return axios({
    method: 'GET',
    url: '/basicInfo/findByProcurementPlan/'+planId,
  })
}


// 详情
export const getwlId = (id) => {
  return axios({
    method: 'GET',
    url: '/warehousing/findWarehousingMaterailDetail/'+id,
  })
}

export const exportWarehousing =(params)=>{
  return axios({
    method: 'GET',
    url: '/warehousing/exportWarehousing',
    responseType: 'blob',
    params
  })
}
